/*
 * junzhinuo all rights received.
 */
package com.junzhinuo.cqpzxx.service;

import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import javax.annotation.Resource;
import com.junzhinuo.cqpzxx.adapter.wordpress.WordPressAdapter;
import com.junzhinuo.cqpzxx.adapter.wordpress.WpPosts;
import org.springframework.stereotype.Service;

/**
 *
 * @author Didy
 */
@Service
public class CmsService {

    @Resource
    WordPressAdapter wordPressAdapter;

    public WpPosts getPost(Long id) {
        return wordPressAdapter.getPost(id);
    }

    public Map<String, String> getOptions() {
        return wordPressAdapter.getOptions();
    }

    public Collection<WpPosts> getPostsByCategory(Long categoryId, int offset, int limit) throws IOException {
        return wordPressAdapter.getPostsByCategory(categoryId, offset, limit);
    }

    public WpPosts getPage(String name) {
        return wordPressAdapter.getPage(name);
    }

    public Collection<WpPosts> getSubpages(Long id) {
        return wordPressAdapter.getSubpages(id);
    }

    public String getPostCover(Long id) {
        return wordPressAdapter.getPostCover(id);

    }

}
